package cxt.cn.community.controller;

import cxt.cn.community.entity.Dto.AdminInfoDto;
import cxt.cn.community.entity.Dto.AdminLoginDto;
import cxt.cn.community.entity.User;
import cxt.cn.community.service.adminService;
import cxt.cn.community.utils.CommonResult;
import cxt.cn.community.utils.FileUploadResource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.tomcat.util.http.fileupload.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

/*
 * @Author chenxiaotian
 * @Description:
 * @Date:2023012023/1/11
 * @Time:11:33
 */
@RestController
@RequestMapping("/api")
@Api(tags="系统 用户信息接口")
public class userController {


    @Autowired
    adminService adminService;

    /**
     * 用户登录
     * @return
     */
    @PostMapping("/modifyUserInfo")
    @ApiOperation("用户信息修改")
    public CommonResult modifyUserInfo(@RequestBody @Validated AdminInfoDto adminInfoDto){

        if (adminService.modifyUserInfo(adminInfoDto)==0) {
            return CommonResult.failed("修改失败");
        }
        return CommonResult.success("修改成功");
    }



}
